<template>
  <el-card shadow="never" style="margin-bottom:20px;">
    <div slot="header" class="clearfix">
      <span>中心重点工作</span>
      <div style="float: right; padding: 3px 0" type="text">
        <a @click="showDetails()">查看全部 &gt;</a>
      </div>
    </div>
    <el-table :show-header="false" :data="users" class="left_menu_side">
      <el-table-column prop="subject" :show-overflow-tooltip="true" label="公文名称">
        <template slot-scope="scope">
          <a @click="getMore(scope.row)" >{{scope.row.subject}}</a>
        </template>
      </el-table-column>
      <el-table-column prop="publisher" label="发布人"></el-table-column>
      <el-table-column prop="publishtime" label="发布时间" width="180" align="right"></el-table-column>
    </el-table>
  </el-card>
</template>
<script type="text/javascript">
import { ACCESS_TOKEN } from "@/store/mutation-types"
import Vue from 'vue'
import { handleUrl, openIFrame } from '@/utils/util'
export default {
  name: 'importent',
  data() {
    return {
      users: []
    }
  },
  mounted() {
    this.getAdminList()
  },
  methods: {
    getMore(row) {
      let baseUrl = process.env.VUE_APP_ADD_HTTP;
      let ticket = Vue.ls.get(ACCESS_TOKEN);
      let ReturnUrl = encodeURIComponent('/Modules/PublicDocument/view/view.htm?id=');
      let id = row.docid;
      let title = row.subject;
      let url = baseUrl + "/Modules/Login/EgovPlatformLogin.aspx?LoginMethod=ssologin&ticket=" +
        ticket + "&ReturnUrl=" + ReturnUrl + id + "";
      openIFrame("CenterKeyWork-"+id, '/CenterKeyWork/' + id, title, url);
      this.$router.push({ name: "CenterKeyWork-"+id })
    },
    getAdminList() {
      let that = this;
      let params = {
        serviceName: 'Xinfo.Bus.BL.Service.EgovPlatform.PortalLet.PublicDocmentPortalLetService,Xinfo.Bus.BL.Service',
        getCount: false,
        guid: 'xxzx_zxzdgz',
        intTypeId: 47,
        strBizType: ''
      }
      this.getRequest('/PortalLet/GetPortalLetData', params).then(res => {
        that.users = res.data;
      })
    },
    showDetails() {
      let ticket = Vue.ls.get(ACCESS_TOKEN);
      let ReturnUrl = encodeURIComponent('/Modules/PublicDocument/index.htm?request=CenterKeyWorkList&request_type=2#');
      let baseUrl = process.env.VUE_APP_ADD_HTTP;
      let url = baseUrl + '/login.xip?LoginMethod=ssologin&ticket=' +
        ticket + "&ReturnUrl=" + ReturnUrl + "";
      let title = '中心重点工作列表';
      openIFrame("CenterKeyWorkList", '/CenterKeyWorkList', title, url);
      this.$router.push({ name: "CenterKeyWorkList" })
    }
  }
}
</script>